import request from './request';

const api_vue = process.env.VUE_APP_API;

// 获取热门评论
export const hotComments = params => {
  return request({
    method: 'get',
    url: `${api_vue}/comment/hot`,
    params
  })
}

// 获取歌单评论
export const songsComments = params => {
  return request({
    method: 'get',
    url: `${api_vue}/comment/playlist`,
    params
  })
}

// 获取专辑评论
export const albumComments = params => {
  return request({
    method: 'get',
    url: `${api_vue}/comment/album`,
    params
  })
}

// 获取歌单收藏者
export const collectorsList = params => {
  return request({
    method: 'get',
    url: `${api_vue}/playlist/subscribers`,
    params
  })
}

// 获取用户详情信息
export const userInfo = params => {
  return request({
    method: 'get',
    url: `${api_vue}/user/detail`,
    params
  })
}

// 获取用户歌单
export const playListU = params => {
  return request({
    method: 'get',
    url: `${api_vue}/user/playlist`,
    params
  })
}

// 获取用户每日推荐歌单(需登录)
export const resource = () => {
  return request({
    method: 'get',
    url: `${api_vue}/recommend/resource?timestamp=${new Date().getTime()}`
  })
}

// 获取用用户每日推荐歌曲(需登录)
export const recommendSongs = () => {
  return request({
    method: 'get',
    url: `${api_vue}/recommend/songs?timestamp=${new Date().getTime()}`
  })
}

// 获取用户最近播放歌曲
export const recentPlay = () => {
  return request({
    method: 'get',
    url: `${api_vue}/record/recent/song?timestamp=${new Date().getTime()}`
  })
}

// 获取歌手详情
export const artistDetail = id => {
  return request({
    method: 'get',
    url: `${api_vue}/artist/detail?id=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取歌手热门50首
export const hotSongs = id => {
  return request({
    method: 'get',
    url: `${api_vue}/artist/top/song?id=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取歌手相关MV
export const singerMV = params => {
  return request({
    method: 'get',
    url: `${api_vue}/artist/mv`,
    params
  })
}

// 获取歌手专辑
export const artistAlbum = params => {
  return request({
    method: 'get',
    url: `${api_vue}/artist/album`,
    params
  })
}

// 获取专辑内容
export const albumInfo = id => {
  return request({
    method: 'get',
    url: `${api_vue}/album?id=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取歌手描述
export const singerDetail = id => {
  return request({
    method: 'get',
    url: `${api_vue}/artist/desc?id=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取相似歌手
export const simiArtist = id => {
  return request({
    method: 'get',
    url: `${api_vue}/simi/artist?id=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取收藏歌手列表
export const subList = () => {
  return request({
    method: 'get',
    url: `${api_vue}/artist/sublist?timestamp=${new Date().getTime()}`
  })
}

// 专辑动态信息
export const dynamicAlbum = id => {
  return request({
    method: 'get',
    url: `${api_vue}/album/detail/dynamic?id=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取收藏专辑列表
export const subAlbumList = params => {
  return request({
    method: 'get',
    url: `${api_vue}/album/sublist`,
    params
  })
}

// 获取收藏的MV列表
export const subMvList = () => {
  return request({
    method: 'get',
    url: `${api_vue}/mv/sublist?timestamp=${new Date().getTime()}`
  })
}

// 获取歌词
export const lyric = id => {
  return request({
    method: 'get',
    url: `${api_vue}/lyric?id=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取歌曲评论
export const musicComment = params => {
  return request({
    method: 'get',
    url: `${api_vue}/comment/music`,
    params
  })
}

// 获取视频评论
export const videoComment = params => {
  return request({
    method: 'get',
    url: `${api_vue}/comment/video`,
    params
  })
}

// 获取视频详情
export const videoDetail = id => {
  return request({
    method: 'get',
    url: `${api_vue}/video/detail?id=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取视频点赞转发数
export const videoShare = id => {
  return request({
    method: 'get',
    url: `${api_vue}/video/detail/info?vid=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取mv详情
export const mvDetail = id => {
  return request({
    method: 'get',
    url: `${api_vue}/mv/detail?mvid=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取mv评论
export const mvComment = params => {
  return request({
    method: 'get',
    url: `${api_vue}/comment/mv`,
    params
  })
}

// 获取MV点赞转发数
export const mvShare = id => {
  return request({
    method: 'get',
    url: `${api_vue}/mv/detail/info?mvid=${id}&timestamp=${new Date().getTime()}`
  })
}

// 获取热搜列表
export const searchDetail = () => {
  return request({
    method: 'get',
    url: `${api_vue}/search/hot/detail?timestamp=${new Date().getTime()}`
  })
}

// 默认搜索关键词
export const defaultKey = () => {
  return request({
    method: 'get',
    url: `${api_vue}/search/default?timestamp=${new Date().getTime()}`
  })
}

// 点击热榜搜索
export const cloudSearch = params => {
  return request({
    method: 'get',
    url: `${api_vue}/cloudsearch`,
    params
  })
}

// 获取搜索建议
export const searchSuggest = keyword => {
  return request({
    method: 'get',
    url: `${api_vue}/search/suggest?keywords=${keyword}&timestamp=${new Date().getTime()}`
  })
}